#ifndef COHESION_H
#define COHESION_H

#include "SteeringBehaviour.h"

namespace Engine
{
	namespace SteeringBehaviourTypes
	{
		const unsigned int COHESION = Hash("Cohesion");
	}

	class Cohesion : public SteeringBehaviour
	{
		private:
			float m_threshold;
			float m_thresholdSquared;
			float m_decayCoefficient;

		public:
			//inherited from SteeringBehaviour
			virtual void Update(SteeringOutput* output) override;
			virtual const char* GetTypeName() const override {return "Cohesion";}
			virtual unsigned int GetHash() const override {return SteeringBehaviourTypes::COHESION;}
			virtual void Draw() override;

			Cohesion();

			//threshold distance at which object will begin to attempt to move closer
			void SetThreshold(float t) {m_threshold = t; m_thresholdSquared = t * t;}

			//holds the constant coefficient of decay for the inverse square law force
			void SetDecayCoefficient(float d) {m_decayCoefficient = d;}

			float GetThreshold() const {return m_threshold;}

			float GetDecayCoefficient() const {return m_decayCoefficient;}

	};
}

#endif